import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";

// 查询巡查线路列表
export function listLine(query) {
  return request({
    url: '/patrol/line/list',
    method: 'get',
    params: query
  })
}

export function listLineAll(query) {
  return request({
    url: '/patrol/line/optionselect',
    method: 'get',
    params: query
  })
}
// 查询巡查线路详细
export function getLine(id) {
  return request({
    url: '/patrol/line/' + praseStrEmpty(id),
    method: 'get'
  })
}

// 新增巡查线路
export function addLine(data) {
  return request({
    url: '/patrol/line',
    method: 'post',
    data: data
  })
}

// 修改巡查线路
export function updateLine(data) {
  return request({
    url: '/patrol/line',
    method: 'put',
    data: data
  })
}

// 删除巡查线路
export function delLine(id) {
  return request({
    url: '/patrol/line/' + id,
    method: 'delete'
  })
}

// 导出巡查线路
export function exportLine(query) {
  return request({
    url: '/patrol/line/export',
    method: 'get',
    params: query
  })
}
